/*
 * Copyright 2005-2013 biz-united. All rights reserved.
 * Support: http://www.biz-united.com.cn
 * License: http://www.biz-united.com.cn/?page_id=5&act=3
 */
package net.biz.dao.impl;

import java.math.BigDecimal;

import javax.annotation.Resource;
import javax.persistence.Query;

import org.springframework.stereotype.Repository;

import net.biz.dao.NativeBaseDao;
import net.biz.dao.OrderItemDao;
import net.biz.entity.OrderItem;

/**
 * Dao - 订单项
 * 
 * @author BIZ Team
 * @version 3.0
 */
@Repository("orderItemDaoImpl")
public class OrderItemDaoImpl extends BaseDaoImpl<OrderItem, Long> implements OrderItemDao {

	@Resource(name="nativeBaseDaoImpl")
	private NativeBaseDao nativeBaseDao;

	@Override
	public int updateSchemeProduct(Long id,Boolean isShopAdd,BigDecimal differencePrice,Long shopSchemeProduct) {
		// TODO Auto-generated method stub
		String sql=" update  xx_order_item set difference_price=:differencePrice,shop_scheme_product=:shopSchemeProduct,is_shop_add=:isShopAdd where id=:id";
		Query query = entityManager.createNativeQuery(sql);
		query.setParameter("id", id);
		query.setParameter("differencePrice", differencePrice);
		query.setParameter("shopSchemeProduct", shopSchemeProduct);
		query.setParameter("isShopAdd", isShopAdd);
		int i=query.executeUpdate();
		return i;
	}

}